package com.bt.dmdb.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "ODS_SITES")
@SuppressWarnings("serial")
public class Site implements java.io.Serializable {

    private long id;
    private Customer customer;
    private Long bfgSiteId;
    private Long bfgLocationId;
    private Set<PropSite> propSites = new HashSet<PropSite>(0);
    private Set<DmEntity> dmEntities = new HashSet<DmEntity>(0);
    private Set<ProjectSite> projectSites = new HashSet<ProjectSite>(0);

    public Site() {
    }

    public Site(long id) {
        this.id = id;
    }

    public Site(long id, Customer customer, Long bfgSiteId, Long bfgLocationId, Set<PropSite> propSites, Set<DmEntity> dmEntities, Set<ProjectSite> projectSites) {
        this.id = id;
        this.customer = customer;
        this.bfgSiteId = bfgSiteId;
        this.bfgLocationId = bfgLocationId;
        this.propSites = propSites;
        this.dmEntities = dmEntities;
        this.projectSites = projectSites;
    }

    @Id
    @Column(name = "ID", unique = true, nullable = false, precision = 10, scale = 0)
    public long getId() {
        return this.id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CUST_ID")
    public Customer getCustomer() {
        return this.customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    @Column(name = "BFG_SITE_ID", precision = 10, scale = 0)
    public Long getBfgSiteId() {
        return this.bfgSiteId;
    }

    public void setBfgSiteId(Long bfgSiteId) {
        this.bfgSiteId = bfgSiteId;
    }

    @Column(name = "BFG_LOCATION_ID", precision = 10, scale = 0)
    public Long getBfgLocationId() {
        return this.bfgLocationId;
    }

    public void setBfgLocationId(Long bfgLocationId) {
        this.bfgLocationId = bfgLocationId;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "site")
    public Set<PropSite> getPropSites() {
        return this.propSites;
    }

    public void setPropSites(Set<PropSite> propSites) {
        this.propSites = propSites;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "site")
    public Set<DmEntity> getDmEntities() {
        return this.dmEntities;
    }

    public void setDmEntities(Set<DmEntity> dmEntities) {
        this.dmEntities = dmEntities;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "site")
    public Set<ProjectSite> getProjectSites() {
        return this.projectSites;
    }

    public void setProjectSites(Set<ProjectSite> projectSites) {
        this.projectSites = projectSites;
    }
}
